/*************
 **
 ** Project:      stopwatch
 ** File info:    $Id: main.cpp 15 2012-05-03 03:37:27Z Kuzma.Shapran@gmail.com $
 ** Author:       Copyright (C) 2011 Kuzma Shapran <Kuzma.Shapran@gmail.com>
 ** License:      GPLv3
 **
 **  This file is part of Stopwatch.
 **
 **  Stopwatch is free software: you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License as published by
 **  the Free Software Foundation, either version 3 of the License, or
 **  (at your option) any later version.
 **
 **  Stopwatch is distributed in the hope that it will be useful,
 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 **  GNU General Public License for more details.
 **
 **  You should have received a copy of the GNU General Public License
 **  along with Stopwatch.  If not, see <http://www.gnu.org/licenses/>.
 **
 *************/

#include <QtGui/QApplication>
#include <QtDeclarative>

#include "qmlapplicationviewer.h"
#include "qmlelapsedtimer.hpp"


Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QApplication> app(createApplication(argc, argv));

    QmlApplicationViewer viewer;
    qmlRegisterType<QMLElapsedTimer>("core", 1, 0, "ElapsedTimer");
    viewer.rootContext()->setContextProperty("majorVersion", QVariant(QString(QLatin1String(
        #include "version_major.inl"
        ))));
    viewer.rootContext()->setContextProperty("minorVersion", QVariant(QString(QLatin1String(
        #include "version_minor.inl"
        ))));
    viewer.rootContext()->setContextProperty("revision", QVariant(QString(QLatin1String(
        #include "revision.inl"
        ))));
    viewer.setMainQmlFile(QLatin1String("qrc:/main.qml"));
    viewer.showExpanded();

    return app->exec();
}
